package com.zhanhong.opencvdemo.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.zhanhong.opencvdemo.R;
import com.zhanhong.opencvdemo.adapter.AnswerAdapter;

public class ResultActivity extends AppCompatActivity {

    public static void startAction(Context context) {
        Intent intent = new Intent(context, ResultActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        initView();
    }

    private void initView() {
        findViewById(R.id.tv_exit).setOnClickListener(v -> finish());
        RecyclerView rvResult = findViewById(R.id.rv_result);
        rvResult.setLayoutManager(new LinearLayoutManager(this));
        rvResult.setAdapter(new AnswerAdapter(this, MainActivity.mAnswers));
    }
}
